<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			var EventUtil = {
			    addHandler: function (element, type, handler) {
			        if (element.addEventListener) {
			            element.addEventListener(type, handler, false);
			        } else if (element.attachEvent) {
			            element.attachEvent("on" + type, handler);
			        } else {
			            element["on" + type] = handler;
			        }
			    }
			};
			EventUtil.addHandler(window, "pagehide", function (event) {
			    alert("Hiding. Persisted? " + event.persisted);
			});
		</script>
	</body>
</html>